// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
//主页
import home from '@/views/home/home';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
// 用户管理
import user from '@/views/user/user';
// 新建博文
import blog from '@/views/blog/blog';
//评论管理
import comment from '@/views/system/comment';
// 博文管理
import blogman from '@/views/system/blogman';
// 分类管理
import sort from '@/views/system/sort';
// 标签管理
import biaoqian from '@/views/system/biaoqian';
// 关于我们
import story from '@/views/mine/story';
// 图表界面
import statistics from '@/views/charts/statistics';

import music from '@/views/music/music';
import mine from '@/views/mine/mine';
import liuyan from '@/views/liuyan/liuyan';
import blogshow from '@/views/blog/blogshow';
// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    mode: 'history',
    routes: [{
        path: '/',
        name: '',
        component: home,
        hidden: true,
        meta: {
            requireAuth: false
        }
    },{
        path: '/home',
        name: '主页',
        component: home,
        hidden: true,
        meta: {
            requireAuth: false
        }
    },
     {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    },
    {
        path: '/blog/blogshow',
        name: '文章显示',
        component: blogshow,
        hidden: true,
        meta: {
            requireAuth: false
        }
    },
    {
        path: '/music/music',
        name: '音乐',
        component: music,
        hidden: true,
        meta: {
            requireAuth: false
        }
    },
    {
        path: '/liuyan/liuyan',
        name: '留言',
        component: liuyan,
        hidden: true,
        meta: {
            requireAuth: false
        }
    },
    {
        path: '/mine/mine',
        name: '关于作者',
        component: mine,
        hidden: true,
        meta: {
            requireAuth: false
        }
    },
    {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/user/user',
            name: '用户管理',
            component: user,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/blog/blog',
            name: '新建文章',
            component: blog,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/comment',
            name: '用户评论',
            component: comment,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/blogman',
            name: '博文管理',
            component: blogman,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/sort',
            name: '分类管理',
            component: sort,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/biaoqian',
            name: '标签管理',
            component: biaoqian,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/mine/story',
            name: '关于我们',
            component: story,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/charts/statistics',
            name: '数据可视化',
            component: statistics,
            meta: {
                requireAuth: true
            }
        }]
    }]
})